﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GrayParrot.Web.Formly;

namespace FimetContoDeposito.BLL.Metadata
{
    public class MovimentiMetadata
    {
        [FormFieldAttribute(Type = FormFieldTypes.Input)]
        [TextTemplateOptionsAttribute(Label = "Num. DDT",
            Placeholder = "Indicare il numero di DDT",
            Required = true,
            MinLength = 1,
            MaxLength = 50)]
        public string NumeroDdt { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Input)]
        [TextTemplateOptionsAttribute(Label = "Num. Documento",
            Placeholder = "Indicare il numero di documento",
            Required = true,
            MinLength = 1,
            MaxLength = 50)]
        public string NumeroDocumento { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Tipo operazione",
                               Placeholder = "Indicare il tipo operazione...",
                               Required = true,
                               Callback = "/api/Common/LoadTipoOperazioni", ForceLoad = true)]
        public Guid TipoOperazione { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Tipo operazione",
                               Placeholder = "Indicare il tipo operazione...",
                               Required = true,
                               Callback = "/api/Common/LoadTipoMovimento", ForceLoad = true)]
        public Guid TipoMovimento { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.DateTimepicker)]
        [DateTimeTemplateOptions(Label="Data movimento",
                                 Placeholder = "Indicare la data del movimento...",
                                 Required = true,
                                 RenderingMode=DateTimeRenderingModes.DropDown)]
        public DateTime DataMovimento { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Cliente",
                               Placeholder = "Indicare il Cliente a cui fa capo il movimento di conto deposito...",
                               Required = true,
                               Callback = "/api/Common/LoadCustomers", ForceLoad = true)]
        public Guid Customer { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Articolo",
                               Placeholder = "Indicare l'articolo...",
                               Required = true,
                               Callback = "/api/Common/LoadArticolo", ForceLoad = true)]
        public Guid Articolo { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "Quantità", Placeholder = "Quantità...", Required = true, Disabled = false)]
        public decimal Quantita { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "Prenotata", Placeholder = "Indica la quantità da considerare prenotata...", 
            Required = true, Disabled = false, Value = 0.0)]
        public decimal Prenotata { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Textarea)]
        [TextAreaTemplateOptions(Label = "Note",
            Placeholder = "Indicare le note se necessarie...",
            Required = false,
            Rows=3,
            Cols=10)]
        public string Note { get; set; }

        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "Disp. Bolla", Placeholder = "Indicare la disp. bolla...", Required = false, Disabled = false)]
        public decimal? DispBolla { get; set; } 
    }
}
